package com.mzj.saas.mservice.property.controller;

import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.property.service.RepairsAppService;
import com.mzj.saas.mservice.property.vo.RepairsPaymentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 报修app操作
 *
 * @author hp
 */
@Controller
@RequestMapping("/repairs/app")
public class RepairsAppController {
    @Autowired
    private RepairsAppService repairsAppService;

    /**
     * 报修支付
     *
     * @param accessToken
     * @return
     */
    @PostMapping("/payment")
    @ResponseBody
    public ResultBean<Map<String, Object>> payment(@RequestHeader String accessToken, @RequestBody RepairsPaymentVo vo) {
        return repairsAppService.payment(accessToken, vo);
    }

    /**
     * 小程序 - 报修支付
     *
     * @param accessToken
     * @return
     */
    @PostMapping("/appletPayment")
    @ResponseBody
    public ResultBean<Map<String, Object>> appletPayment(@RequestHeader String accessToken, @RequestBody RepairsPaymentVo vo) {
        return repairsAppService.appletPayment(accessToken, vo);
    }


}
